// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#000');

// create tab group
var tabGroup = Titanium.UI.createTabGroup();

//
//create base UI tab and root window
//
var win1 = Titanium.UI.createWindow({className:'win1'});

var tab1 = Titanium.UI.createTab({
	id:'tab1',
 window:win1
});

//
//create platform tab and root window
//
var nameWin = Titanium.UI.createWindow({
 url:'windows/namewin.js',
 title:'Parent Name Window'
});
var nameTab = Titanium.UI.createTab({
 icon:'KS_nav_platform.png',
 title:'Parent Name Tab',
 window:nameWin
});

var whereWin = Titanium.UI.createWindow({
	 url:'windows/wherewin.js',
	 title:'Parent Where Window'
	});
	var whereTab = Titanium.UI.createTab({
	 icon:'KS_nav_platform.png',
	 title:'Parent Where Tab',
	 window:whereWin
	});

var whenWin = Titanium.UI.createWindow({  
    title:'When',
    backgroundColor:'#fff'
});
var whenTab = Titanium.UI.createTab({  
    icon:'KS_nav_views.png',
    title:'When',
    window:whenWin
});

var whenLabel = Titanium.UI.createLabel({
	color:'#999',
	text:'I am the When window',
	font:{fontSize:20,fontFamily:'Helvetica Neue'},
	textAlign:'center',
	width:'auto'
});

whenWin.add(whenLabel);

//
//  add tabs
//
tabGroup.addTab(tab1);  
tabGroup.addTab(nameTab);  
tabGroup.addTab(whereTab);  
tabGroup.addTab(whenTab);  


// open tab group
tabGroup.open();
